<?php

/**旅行社模型
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/19 0019
 * Time: 9:50
 */

namespace App\Models;
use Auth;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Agency extends Model
{

    public function agencyMenu(){
        $data = DB::table('tour_menu')->get()->toArray();
        $data = $this->objectToArray($data);
        print_r($data);
    }

    function objectToArray($object) {
        //先编码成json字符串，再解码成数组
        return json_decode(json_encode($object), true);
    }

}